... was founded in 1565 and became the capital of the State of Brazil in 1763. In 1808 the Portuguese Royal Court moved to Rio, and Queen Maria I subsequently made Brazil a kingdom in its own right, within the United Kingdom of Portugal, Brazil and Algarves.
Rio remained the capital of the Lusitanian monarchy until 1822, when the War of Brazilian Independence began. To quote Wikipedia, "This is one of the few instances in history that the capital of a colonizing country officially shifted to a city in one of its colonies."
Following independence, Rio continued as the capital of the Empire of Brazil until 1889, and as the capital of the Brazilian republic until 1960 when the capital was transferred to Brasília.
© Haydn Thompson 2021